<template>
	<view class="box">
		<view class="img">
			<image src="../../static/noData/no-data.png" />
		</view>
		<view class="text">{{noDataText}}</view>
		<view class="button" @click="back()" v-if="buttonShow">返回</view>
	</view>
</template>

<script>
	export default {
		props: {
			noDataText: {
				type: String,
				default: '暂无信息'
			},
			buttonShow: {
				type: Boolean,
				default: true
			},
		},
		name: "noData",
		data() {
			return {};
		},
		methods: {
			/**
			 * 返回
			 */
			back(){
				uni.navigateBack()
			},
		}
	}
</script>

<style lang="scss">
	/* 缺省页 */
	.box {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-wrap: wrap;
		
		.img {
			margin-top: 60rpx;
			width: 394rpx;
			height: 394rpx;
		
			img {
				width: 100%;
				height: 100%;
			}
		}
		
		.text {
			width: 100%;
			text-align: center;
			padding: 40rpx 0;
			color: #AFAFAF;
			font-size: 30rpx;
		}
		
		.button {
			width: 200rpx;
			height: 72rpx;
			line-height: 72rpx;
			text-align: center;
			margin: 0rpx auto 100rpx auto;
			border-radius: 80rpx;
			color: #FFFFFF;
			background: #1585FC;
		}
	}
</style>